package com.jinxin.platform.cdsmsmgr.pojo.enums;

/**
 * @Author 那个男人
 * @Date 2023/1/6 15:47
 * @Version 1.0
 */
public enum TemplateStatusAliEnum {
    INIT(0,"审核中"),
    PASS(1,"审核通过"),
    NOT_PASS(2,"审核未通过"),
    CANCEL(3,"取消审核");

    private long code;
    private String desc;

    TemplateStatusAliEnum(long code, String desc) {
        this.code = code;
        this.desc = desc;
    }
    // 普通方法
    public static String getDesc(long code) {
        for (TemplateStatusAliEnum c : TemplateStatusAliEnum.values()) {
            if (c.getCode() == code) {
                return c.desc;
            }
        }
        return null;
    }

    public static Long getCode(String desc) {
        for (TemplateStatusAliEnum c : TemplateStatusAliEnum.values()) {
            if (c.getDesc().equals(desc)) {
                return c.code;
            }
        }
        return null;
    }

    public long getCode() {
        return code;
    }

    public void setType(long code) {
        this.code = code;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }
}
